<template>
  <div>
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="日期选择">
        <el-date-picker
          v-model="dateRange"
          style="width: 240px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          :default-time="['00:00:00', '23:59:59']"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="状态" prop="status">
        <el-select
          v-model="queryParams.status"
          placeholder="状态"
          clearable
          style="width: 120px"
        >
          <el-option
            v-for="dict in selectoption"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="网单编号" prop="userName">
        <el-input
          v-model="queryParams.userName"
          placeholder="网单编号"
          clearable
          style="width: 180px;"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="长度" prop="userName">
        <el-input
          v-model="queryParams.userName"
          placeholder="长度"
          clearable
          style="width: 120px;"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="宽度" prop="userName">
        <el-input
          v-model="queryParams.userName"
          placeholder="宽度"
          clearable
          style="width: 120px;"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="客户PO" prop="userName">
        <el-input
          v-model="queryParams.userName"
          placeholder="客户PO"
          clearable
          style="width: 120px;"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">

      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <Table
      ref="tableref"
      :tableHeader="tableHeader"
    >
      <template slot="table-operate" slot-scope="scope">
        <el-link @click="handleComplaint(scope.row)" type="danger" :underline="false">投诉</el-link>
      </template>
    </Table>
    <el-dialog :title="title" :visible.sync="dialogVisible" :close-on-click-modal="false">
      <Complaint ref="Complaint"/>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import Complaint from './Complaint'
import Table from '@/components/Table'

export default {
  name: 'StatusOrderList',
  components: { Complaint, Table },
  data() {
    return {
      dialogVisible: false,
      title: '投诉登记',
      tableHeader: [
        { label: '状态', prop: '', fixed: 'left', width: '' },
        { label: '楞型', prop: '', width: '' },
        { label: '材质', prop: '', width: '' },
        { label: '下单数量', prop: '', width: '' },
        { label: '实际数量', prop: '', width: '' },
        { label: '长', prop: '', width: '' },
        { label: '宽', prop: '', width: '' },
        { label: '毛净片', prop: '', width: '' },
        { label: '产线', prop: '', width: '' },
        { label: '压线', prop: '', width: '' },
        { label: '压线类型', prop: '', width: '' },
        { label: '下单时间', prop: '', width: '' },
        { label: '司机', prop: '', width: '' },
        { label: '电话', prop: '', width: '' },
        { label: '生产单号', prop: '', width: '' },
        { label: '网单号码', prop: '', width: '' },
        { label: '发货数量', prop: '', width: '' },
        { label: '签收数量', prop: '', width: '' },
        { label: '客户名称', prop: '', width: '' },
        { label: '客户编码', prop: '', width: '' },
        { label: '交货单号', prop: '', width: '' },
        { label: '车牌', prop: '', width: '' },
        { label: 'PO号码', prop: '', width: '' },
        { label: '业务员', prop: '', width: '' }
      ],
      selectoption: [
        {
          label: '未提交',
          value: 1
        },
        {
          label: '审批拒绝',
          value: 2
        }
      ],
      // 显示搜索条件
      showSearch: true,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10
      },
      dateRange: []
    }
  },
  created() {
  },
  methods: {
    /**
     * 投诉
     **/
    handleComplaint(row) {
      this.dialogVisible = true

    },
    /**
     * 获取列表
     **/
    getList(){

    },
    /**
     * TODO 提交
     **/
    handleSubmit(row) {

    },
    /**
     * TODO 删除
     **/
    handleDel(row) {

    },
    /**
     * TODO 批量删除
     **/
    handleDels() {

    },
    /**
     * TODO 批量提交
     **/
    handleSubmits() {

    },

    /**
     * TODO 搜索按钮操作
     * */
    handleQuery() {
      this.queryParams.pageNum = 1
    },
    /**
     * TODO 重置按钮操作
     * */
    resetQuery() {
      this.dateRange = []
      this.queryParams.pageNum = 1
    }
  }
}
</script>

